package org.gaaidou.ptarmigan.server.app;

import org.gaaidou.ptarmigan.server.io.Handler;
import org.gaaidou.ptarmigan.server.protocol.HttpRequest;
import org.gaaidou.ptarmigan.server.protocol.HttpResponse;

import java.util.Map;

public class PersonHandler implements Handler {
    @Override
    public HttpResponse handle(HttpRequest request) {
        return HttpResponse.builder()
                .statusCode(200)
                .reasonPhrase("OK")
                .header(Map.of("Content-Type", "text/html;charset=UTF-8"))
                .body("<h1>Hello, My name is Martin</h1>")
                .build();
    }
}
